package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.user.UserInfo;
import com.atguigu.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(value = "service-user", fallback = UserInfoDegradeFeignClient.class)
public interface UserInfoFeignClient {
    /**
     * 根据用户Id获取到用户信息
     * @author Petrichor
     * @date 2023/12/26 21:09
     * @param userId 用户id
     * @return UserInfo 用户信息
     **/
    @GetMapping(value = "/api/user/userInfo/findUserInfoByUserId/{userId}")
    public Result<UserInfo> findUserInfoByUserId(@PathVariable(value = "userId") Long userId);
    /**
     * @description: 获取登录信息
     * @author Petrichor
     * @date 2024/1/1 15:05
     * @return 用户登录信息
    **/
    @GetMapping(value = "/api/user/wxLogin/getUserInfo")
    public Result<UserInfoVo> getUserInfoVo() ;
    /**
     * @description: 判断用户是否购买声音列表
     * @author Petrichor
     * @date 2024/1/1 15:28
     * @param albumId 专辑id
     * @return trackIdList 声音id列表
     **/
    @PostMapping("/api/user/userInfo/userIsPaidTrack/{albumId}")
    public Result<Map<Long , Integer>> userIsPaidTrack(@PathVariable(value = "albumId") Long albumId,@RequestBody List<Long> trackIdList ) ;
    /**
     * @description: 判断用户是否购买过专辑
     * @author Petrichor
     * @date 2024/1/6 16:25
     * @param albumId 专辑id
     * @return 是否购买过专辑
     **/
    @GetMapping("/api/user/userInfo/isPaidAlbum/{albumId}")
    public Result<Boolean> isPaidAlbum(@PathVariable Long albumId);
    /**
     * @description: 根据专辑id获取用户支付过的声音id列表
     * @author Petrichor
     * @date 2024/1/7 21:31
     * @param albumId 专辑id
     * @return 查看当前用户的 当前专辑购买的 声音集数 集合
     **/
    @GetMapping("/api/user/userInfo/findUserPaidTrackList/{albumId}")
    public Result<List<Long>> findUserPaidTrackList(@PathVariable Long albumId);

    /**
     * @description: 更新Vip到期失效状态
     * @author Petrichor
     * @date 2024/1/12 19:13
     * @return NULL
     **/
    @GetMapping("updateVipExpireStatus")
    public Result updateVipExpireStatus();
}